<?php 
defined('_JEXEC') or die;

class utilitiesProvider{

    public static function rewriteGlobalUrl($params=null, $lang='') {
        //$app = JFactory::getApplication();
        
        if($lang == ''){
            $lang = JFactory::getLanguage()->getTag();
        }
        
        //$url = HOSTINFO.'/'.$lang;
        $url = JURI::base();
        if(!is_null($params))
        {
            $params = (array)$params;
            foreach($params as $item)
            {
                $url .= $item;
            }
        }
        
        return $url;
    }
}
?>